package com.longwang.controller;

import com.longwang.service.IResouceCatalogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.HashMap;
import java.util.Map;

/**
 * 前台 -- 资源分类控制器
 * @author longwang
 * @create 2018-10-25 17:52
 */
@Controller
@RequestMapping("/resouceCatalog")
public class ResouceCatalogController {

    @Autowired
    private IResouceCatalogService iResouceCatalogService;

    /**
     * 带条件查询
     * @param id
     * @return
     */
    @RequestMapping("/getCatalog")
    @ResponseBody
    public Map<String, Object> list(Long id){
        Map<String, Object> resultMap = new HashMap<>();
        resultMap.put("data", iResouceCatalogService.findAllByPid(id).getData());
        return resultMap;
    }



}
